function find_qualifying()
%
% find the data sets that qualify for an analysis.....
% Written to find stimulus sets for noise analysis of Sarah Street's data.
%
% 9/28/05 P. Manis
%
global CONTROL

lpf = 500;
seed = 1;
minamp = 50;

nsf = length(CONTROL)
sfd = [];
for sf = 1:nsf
    if(CONTROL(sf).fileinpath & CONTROL(sf).div ~= 'Q') % make sure we can look for the file and that it is not already tagged.
        if(strfind(CONTROL(sf).protocol, 'noise') & ...
                (strfind(CONTROL(sf).filename, 'jan04') | strfind(CONTROL(sf).filename, '09dec03')) & ...
                ((CONTROL(sf).recend-CONTROL(sf).recbeg+1) >= 50)) % is the word "noise" in the protocol?
            [st, df, wblk] = block_info2(sf); % get the stim info.
            if(isempty(st) | wblk == 0)
                fprintf(1, '%4d> %s doesn''t seem to contain data.\n', sf, CONTROL(sf).filename);
            else

                if(strfind(st.Method.v, 'noise') ...
                        & st.LPF.v == lpf ...
                        & st.Seed.v == seed ...
                        & st.Amplitude.v > minamp)
                    fprintf(1, 'Q: %4d> %s:  LPF: %8.1f  Seed: %3d   Amp: %8.2f\n', ...
                        sf, CONTROL(sf).filename, st.LPF.v, st.Seed.v, st.Amplitude.v);
                    CONTROL(sf).div = 'Q';
                    sfd=[sfd sf];
                end;
                if(strfind(st.Method.v, 'noise') ...
                        & st.LPF.v == lpf ...
                        & st.Seed.v == seed ...
                        & st.Amplitude.v == 0)
                    fprintf(1, 'F: %4d> %s:  LPF: %8.1f  Seed: %3d   Amp: %8.2f\n', ...
                        sf, CONTROL(sf).filename, st.LPF.v, st.Seed.v, st.Amplitude.v);
                    CONTROL(sf).div = 'F';
                    sfd=[sfd sf];
                end;

            end;
        end;
    end;
end;
setlist(sfd);


